﻿using System;
using System.Collections.Generic;
using System.Linq;
using ZY.EntityFrameWork.Caller.Facade;
using ZY.EntityFrameWork.Core.DBHelper;
using ZY.EntityFrameWork.Core.Model.Dto;
using ZY.EntityFrameWork.Core.Model.Dto.Authority;
using ZY.EntityFrameWork.Core.Model.Entity;
using ZY.EntityFrameWork.Core.Model.Entity.Authority;
using ZY.EntityFrameWork.Core.Services;

namespace ZY.EntityFrameWork.Caller.WinformCaller
{
    public partial class WinAuthorityService
    {
        new public List<RoleDto> GetAllRoles()
        {
            return base.GetAllRoles().MapTo<List<RoleDto>>();
        }

        new public List<RoleModuleDto> GetRolePermissions(string roleName)
        {
            return base.GetRolePermissions(roleName).MapTo<List<RoleModuleDto>>();
        }

        /// <summary>
        /// 更新用户权限
        /// </summary>
        /// <param name="roleModules"></param>
        /// <returns></returns>
        public int UpdateRole(List<RoleModuleDto> dtos)
        {
            return base.UpdateRole(dtos.MapTo<List<RoleModule>>());
        }
    }
}
